<div class="box-title has-cl">
<h1>订单</h1>
<form class="f-search" method="post" action="">
<span class="s-field"><input size="28" type="search" name="s[name]" value="<?php e_h($s['name'])?>" placeholder="订单、商品名" /></span>
<span class="s-field"><label>下单时间</label><input type="text" name="s[timeS]"  value="<?php e_h($s['timeS'])?>" size="10" onClick="WdatePicker()" />-<input type="text" name="s[timeE]"  value="<?php e_h($s['timeE'])?>" size="10" onClick="WdatePicker()" /></span>
<input type="submit" class="sb" value="筛选" /> 
</form>
</div>
<table width="100%" class="ta-h" id="dataList">
  <tbody>
    <?php foreach($res as $v){?>
    <tr class="shop-order">
      <th>订单：<?php echo $v['sn']?></th>
      <th width="205"><?php echo $v['time']?></th>
      <th width="120">状态</th>
      <th width="100">操作</th>
    </tr>
    <tr i_ID="<?php echo $v['id']?>" class="sl-i">
      <td colspan="2" class="has-sub-ta">
        <table width="100%" class="sub-ta"><tbody>
          <?php foreach($detailR[$v['id']] as $g){?>
          <tr>
            <td width="100"><img width="100" height="80" src="<?php e_qh($g['pic'])?>" /></td>
            <td ><a href="<?php echo url::g('u=cgoods\v&id='. $g['goods_id'])?>" target="_blank"><?php e_h($g['name'])?></a></td>
            <td width="200" align="center"><p><?php echo $g['money']?></p><p>x <?php echo $g['num']?></p></td>
          </tr>
          <?php }?></tbody>
        </table>
      </td>
      
      <td align="center">
	    <?php 
		   if($v['pay_money']==$v['money'])
				echo $v['money'];
			else{
				echo '<s>'. $v['money'] .'</s><br />';
				echo $v['pay_money'];
			}
		?><br />
      	<?php echo $state[$v['state']];?>
      </td>
      <td align="center" class="coLin"><p><a target="_blank" href="?u=cshop\order\p-fview&id=<?php echo $v['id']?>">订单信息</a></p>
          <?php if($v['state']==1){?><p><a href="?u=cshop\pay\index&id=<?php echo $v['id']?>">去付款</a></p><?php }?>
          <?php if($v['state']<2){?><p><a onClick="dTA.delRow()" class="icon-16-drop">删除</a></p><?php }?>
          <?php if(in_array($v['state'], array(2,3))){?><p><a onClick="bG(this)" class="cur-p">申请退货</a></p><?php }?>
          <?php if($v['state']==3){?><p><a onClick="tg(this)" class="cur-p">确认收货</a></p><?php }?>
          <?php if($v['state']==5){?><p><a href="#" onClick="pj(this)" class="cur-p">评价</a></p><?php }?>
      </td>
    </tr>
    <?php }?>
  </tbody>
</table>
<?php $this->loadTemplate('paging');?>

<style>
.ta-h tr{background-color:#fff !important}
</style>
<script>
var dTA = Table_Ad.init('#dataList',{u_del: '?u=cshop\\order\\p-fdel&id='});
function bG(o){$.get('?u=cshop\\order\\p-fbGoods&id='+ dTA.getRowID(o), checAjaxRe);}
function tg(o){$.get('?u=cshop\\order\\p-ftakeGoods&id='+ dTA.getRowID(o), function(r){if(checAjaxRe(r))pj(o);});}
function pj(o){o.href = '?u=cgoods\\comment-fpost&data_id='+ dTA.getRowID(o);}
</script>